export const getQueryParam = (url: string, paramName: string) => {
  const queryString = url.split('?')[1]

  if (!queryString) {
    return null
  }

  const queryPairs = queryString.split('&')

  for (const pair of queryPairs) {
    const [key, value] = pair.split('=')
    if (key === paramName) {
      return decodeURIComponent(value || '')
    }
  }

  return null
}
